#include <stdio.h>
#include <math.h>
int IsPrime(unsigned int m)
{
    int i;
    for(i=2;i<=sqrt(m);i++)
    {
        if(0==m%i)
        {
            Fault:return 0;
        }
    }
    return 1;
}
void main()
{
    int sum=0,n,i;
    printf("Input a number:");
    scanf("%d",&n);
    for(i=2;i<=n;i++)
    {
        if(IsPrime(i))
        {
            sum+=i;
        }
    }
    printf("The sum of all the prime is %d",sum);
}
